home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 5 / Amiga Tools 5.iso / grafik / 3d & render tools / irit / man / man6 / printf.6 < prev    next >
Text File  |  1996-07-16  |  2KB  |  58 lines

  1. .TH PRINTF
  2.  6 "IRIT Version 6.0" 
  3. .SH NAME
  4. PRINTF
  5.  
  6.  
  7.  
  8.  PRINTF( StringType CtrlStr, ListType Data )
  9.  
  10. A formatted printing routine, following the concepts of the C programming
  11. language's printf routine. CtrlStr is a string object for which
  12. the following special '%' commands are supported:
  13.  
  14.     %d, %i, %u      Prints the numeric object as an integer or unsigned integer.
  15.     %o, %x, %X      Prints the numeric object as an octal or hexadecimal integer.
  16.     %e, %f, %g,     Prints the numeric object in several formats of
  17.     %E, %F          floating point numbers.
  18.     %s              Prints the string object as a string.
  19.     %pe, %pf, %pg   Prints the three coordinates of the point object.
  20.     %ve, %vf, %vg   Prints the three coordinates of the vector object.
  21.     %Pe, %Pf, %Pg,  Prints the four coordinates of the plane object.
  22.     %De, %Df, %Dg,  Prints the given object in IRIT's data file format.
  23.  
  24.  
  25. All the '%' commands can include any modifier that is valid in the C
  26. programming language printf routine, including l (long), prefix
  27. character(s), size, etc. The point, vector, plane, and object commands
  28. can also be modified in a similar way, to set the format of the
  29. numeric data printed.
  30.  
  31. Also supported are the newline and tab using the backslash escape
  32. character:
  33.  
  34.  PRINTF("\\tThis is the char \"\\%\"\\n", nil());
  35.  
  36. Backslashes should be escaped themselves as can be seen in the above example.
  37. Here are few more examples:
  38.  
  39.  PRINTF("this is a string \"%s\" and this is an integer %8d.\\n",
  40.        list("STRING", 1987));
  41.  PRINTF("this is a vector [%8.5lvf]\\n", list(vector(1,2,3)));
  42.  IritState("DumpLevel", 9);
  43.  PRINTF("this is a object %8.6lDf...\\n", list(axes));
  44.  PRINTF("this is a object %10.8lDg...\\n", list(axes));
  45.  
  46. This implementation of PRINTF is somewhat different than the C programming
  47. language's version, because the backslash always escapes the next
  48. character during the processing stage of IRIT's parser. That is, the string
  49.  
  50.         '\\tThis is the char \"\\%\"\\n'
  51.  
  52. is actually parsed by the IRIT's parser into
  53.  
  54.         '\tThis is the char "\%"\n'
  55.  
  56. because this is the way the IRIT parser processes strings. The latter
  57. string is the one that PRINTF actually see.
  58.